package fr.umlv.m2.jee.pmlv.persistence.planning;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Represents a projector used during a event in a classroom.
 * @author jenseric
 *
 */
@SuppressWarnings("serial")
@Entity
@Table(name="Projector")
public class Projector implements Serializable {

	/**The id of the projector.*/
	@Id
	@GeneratedValue
	@Column(name="projector_id")
	private long id;
	
	/**The name of the projector.*/
	@Column(name="projector_name")
	private String name;
	
	@OneToMany(mappedBy="classroom")
	/**List of event which use the projector.*/
	private List<AbstractEvent> events;
	
	/**
	 * Sets the id of the projector.
	 * @param id the id to set.
	 */
	public void setId(long id) {
		this.id = id;
	}
	
	/**
	 * Returns the id of the projector.
	 * @return the id of the projector.
	 */
	public long getId() {
		return id;
	}
	
	/**
	 * Sets the name of the projector.
	 * @param name the name of the projector to set.
	 */
	public void setName(String name) {
		this.name = name;
	}
	
	/**
	 * Returns the name of the projector.
	 * @return the name of the projector.
	 */
	public String getName() {
		return name;
	}

	public void setEvents(List<AbstractEvent> events) {
		this.events = events;
	}

	public List<AbstractEvent> getEvents() {
		return events;
	}
}
